﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CompositionPlugin
{
    public class ModuleRuntime : Runtime
    {
        public ModuleRuntime(IEnumerable<Tuple<Type, IRuntimeService>> services)
            : base(services)
        {
            // check services
        }

        #region internal

        internal void Initialize()
        {
            // init all module service
        }

        internal void Destroy()
        {
            // destory all module service
        }

        #endregion

        #region protected

        protected override object FailedToRetrieveService(Type serviceContractType)
        {
            // if cannot find the service in module runtime, try system runtime
            return SystemRuntime.Current.GetService(serviceContractType);
        }

        #endregion
    }
}
